﻿/***********************************************************************
 * <copyright file="Acount.cs" company="BUCA JSC">
 * -->    Copyright (C) statement. All right reserved
 * </copyright>
 * 
 * Created:   BangNC
 * Email:    BangNC@buca.vn
 * Website:
 * Create Date: Friday, March 14, 2014
 * Usage: 
 * 
 * RevisionHistory: 
 * Date         Author               Description 
 * 
 * ************************************************************************/


using BusinessObjects;
using BusinessObjects.BusinessRules;


namespace BusinessObjects.BussinessDictionary
{
    /// <summary>
    /// Acount class
    /// </summary>
    public class Account : BusinessObject 
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Acount" /> class.
        /// </summary>
        public Account()
        {
            AddRule(new ValidateRequired("AccountCode"));
            AddRule(new ValidateRequired("AccountName"));
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="Acount" /> class.
        /// </summary>
        /// <param name="accountId">The account identifier.</param>
        /// <param name="accountCode">The account code.</param>
        /// <param name="accountName">Name of the account.</param>
        /// <param name="parentId">The parent identifier.</param>
        /// <param name="grade">The grade.</param>
        /// <param name="detail">if set to <c>true</c> [detail].</param>
        /// <param name="description">The description.</param>
        /// <param name="isCustomer">if set to <c>true</c> [is customer].</param>
        /// <param name="isVendor">if set to <c>true</c> [is vendor].</param>
        /// <param name="isInventoryItem">if set to <c>true</c> [is inventory item].</param>
        /// <param name="isFixedAsset">if set to <c>true</c> [is fixed asset].</param>
        /// <param name="isTax">if set to <c>true</c> [is tax].</param>
        /// <param name="unitId">The unit identifier.</param>
        /// <param name="isActive">if set to <c>true</c> [is active].</param>
        /// <param name="isSystem">if set to <c>true</c> [is system].</param>
        public Account(int accountId, string accountCode, string accountName, int? parentId, int grade, bool detail, 
            string description, bool isCustomer, bool isVendor,  bool isInventoryItem,
            bool isFixedAsset,bool isTax, long unitId, bool isActive, bool isSystem,int balanceSide) 
            : this()
        {
            AccountId = accountId;
            AccountCode = accountCode;
            AccountName = accountName;
            ParentId = parentId;
            Grade = grade;
            IsDetail = detail;
            Description = description;

            IsCustomer = isCustomer;
            IsVendor = isVendor;
            IsInventoryItem = isInventoryItem;
            IsFixedAsset = isFixedAsset;
            IsTax = isTax;
            IsActive = isActive;
            IsSystem = isSystem;
            UnitId = unitId;
            BalanceSide = balanceSide;
        }

        /// <summary>
        /// Gets or sets the account identifier.
        /// </summary>
        /// <value>The account identifier.</value>
        public int AccountId { get; set; }

        /// <summary>
        /// Gets or sets the balanceside.
        /// </summary>
        /// <value>The balanceside.</value>
        public int BalanceSide { get; set; }
        /// <summary>
        /// Gets or sets the account category identifier.
        /// </summary>
        /// <value>The account category identifier.</value>
        public long UnitId { get; set; }

        /// <summary>
        /// Gets or sets the account code.
        /// </summary>
        /// <value>The account code.</value>
        public string AccountCode { get; set; }

        /// <summary>
        /// Gets or sets the name of the account.
        /// </summary>
        /// <value>The name of the account.</value>
        public string AccountName { get; set; } 

        /// <summary>
        /// Gets or sets the parent identifier.
        /// </summary>
        /// <value>The parent identifier.</value>
        public int? ParentId { get; set; }

        /// <summary>
        /// Gets or sets the grade.
        /// </summary>
        /// <value>The grade.</value>
        public int Grade { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is detail.
        /// </summary>
        /// <value><c>true</c> if this instance is detail; otherwise, <c>false</c>.</value>
        public bool IsDetail { get; set; }

        /// <summary>
        /// Gets or sets the description.
        /// </summary>
        /// <value>The description.</value>
        public string Description { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is customer.
        /// </summary>
        /// <value><c>true</c> if this instance is customer; otherwise, <c>false</c>.</value>
        public bool IsCustomer { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is vendor.
        /// </summary>
        /// <value><c>true</c> if this instance is vendor; otherwise, <c>false</c>.</value>
        public bool IsVendor { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is inventory item.
        /// </summary>
        /// <value><c>true</c> if this instance is inventory item; otherwise, <c>false</c>.</value>
        public bool IsInventoryItem { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is fixedasset.
        /// </summary>
        /// <value><c>true</c> if this instance is fixedasset; otherwise, <c>false</c>.</value>
        public bool IsFixedAsset { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is fixedasset.
        /// </summary>
        /// <value><c>true</c> if this instance is fixedasset; otherwise, <c>false</c>.</value>
        public bool IsTax { get; set; } 

        /// <summary>
        /// Gets or sets a value indicating whether this instance is active.
        /// </summary>
        /// <value><c>true</c> if this instance is active; otherwise, <c>false</c>.</value>
        public bool IsActive { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is system.
        /// </summary>
        /// <value><c>true</c> if this instance is system; otherwise, <c>false</c>.</value>
        public bool IsSystem { get; set; }
    }
}
